@extends('layouts.admin.application')

@section('content')
    <div class="main-content">
        <div class="col-xs-12">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="#">首页</a></li>
                    <li><a href="{{ route('system.config.index') }}">系统管理</a></li>
                    <li class="active">系统设置</li>
                </ul>
            </div>

            @include('layouts.partials._flash')

            <form class="form-horizontal" role="form" action="{{ route('system.config.update', 1) }}" method="post"
                  style="margin-top: 10px;">
                {{csrf_field()}}

                {{ method_field('PUT') }}

                <div class="col-sm-12">
                    <div class="tabbable">
                        <ul class="nav nav-tabs" id="myTab">
                            <li class="active">
                                <a data-toggle="tab" href="#home">
                                    <i class="green icon-home bigger-110"></i>
                                    网站信息
                                </a>
                            </li>

                            <li class="">
                                <a data-toggle="tab" href="#profile">
                                    <i class="green icon-h-sign bigger-110"></i>
                                    公司信息
                                </a>
                            </li>

                            <li class="">
                                <a data-toggle="tab" href="#dropdown">
                                    <i class="green icon-rocket bigger-110"></i>
                                    网站图标
                                </a>
                            </li>
                        </ul>

                        <div class="tab-content">
                            <div id="home" class="tab-pane active" style="margin-top: 20px;">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">网站名称</label>

                                    <div class="col-sm-9">
                                        <input type="text" name="title" value="{{$config->title}}"
                                               placeholder="商品名称，你懂得~"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">关键词</label>

                                    <div class="col-sm-9">
                                        <input type="text" name="keyword" value="{{$config->keyword}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">描述信息</label>

                                    <div class="col-sm-9">
                                        <textarea id="description" name="description" cols="47"
                                                  rows="7">{{$config->description}}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">ICP备案号</label>

                                    <div class="col-sm-9">
                                        <input type="text" name="icp" value="{{$config->icp}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">版权信息</label>

                                    <div class="col-sm-9">
                                        <input type="text" name="copyright" value="{{$config->copyright}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">作者</label>

                                    <div class="col-sm-9">
                                        <input type="text" name="author" value="{{$config->author}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>

                            </div>

                            <div id="profile" class="tab-pane" style="margin-top: 20px;">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">管理员</label>
                                    <div class="col-sm-9">
                                        <input type="text" value="{{Auth::user()->name}}" readonly
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">公司名称</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="company" value="{{$config->company}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">QQ</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="qq" value="{{$config->qq}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">电子邮件</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="email" value="{{$config->email}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">手机</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="mobile_phone" value="{{$config->mobile_phone}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">固定电话</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="telephone" value="{{$config->telephone}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">传真</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="fax" value="{{$config->fax}}"
                                               class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                            </div>

                            <div id="dropdown" class="tab-pane" style="margin-top: 20px;">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">网站图标</label>

                                    <div class="col-sm-9">
                                        <div class="am-form-group am-form-file new_thumb">
                                            <button type="button" class="btn-success upload_img">
                                                <i class="icon-cloud-upload" id="loading"></i> 上 传 图 标
                                            </button>
                                            <input type="file" id="image_upload" style="display: none;">
                                            <input type="hidden" name="image" value="{{$config->image}}">
                                        </div>
                                        <hr style="border-top:1px dashed #0066CC;">
                                        <div>
                                            <img src="{{$config->image}}" id="img_show" style="max-height: 200px;">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9" style="margin-top: 20px;">
                        <button class="btn btn-info" type="submit"><i class="icon-ok bigger-110"></i>保存</button>
                        &nbsp; &nbsp; &nbsp;
                        <a class="btn" onclick="javascript:history.back(-1);return false;">
                            <i class="icon-undo bigger-110"></i>返回</a>
                    </div>
                </div>
            </form>
        </div>

    </div>
@endsection

@section('js')
    <script src="/vendor/html5-fileupload/jquery.html5-fileupload.js"></script>
    <script src="/js/upload.js"></script>
@endsection